package string_test;

public class StringTest {
    public static void main(String[] args) {
//      String str1 = new String("hello");
//      str1=str1.intern();
//      String str2 = "hello";
//        System.out.println(str1 == str2);
        String str1 ="123";
        String str2 = "123a";
        System.out.println(isNumber(str1));
        System.out.println(isNumber(str2));
    }
    public static boolean isNumber(String str){
        char[]  data=str.toCharArray();
        for (char c:data){
//            if (c<'0'||c>'9'){
//                return false;
//            }
            if (!Character.isDigit(c)){
                return false;
            }
        }
        return true;
    }
}
